<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Doxygen: common/include/pcl/common/time.h 文件参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Doxygen
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('common_2time_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">类</a> &#124;
<a href="#define-members">宏定义</a> &#124;
<a href="#func-members">函数</a>  </div>
  <div class="headertitle">
<div class="title">time.h 文件参考<div class="ingroups"><a class="el" href="group__common.html">Common components</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;cmath&gt;</code><br />
<code>#include &lt;queue&gt;</code><br />
<code>#include &lt;string&gt;</code><br />
<code>#include &lt;boost/date_time/posix_time/posix_time.hpp&gt;</code><br />
</div>
<p><a href="common_2time_8h_source.html">浏览源代码.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
类</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_stop_watch.html">pcl::StopWatch</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Simple stopwatch.  <a href="classpcl_1_1_stop_watch.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_scope_time.html">pcl::ScopeTime</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Class to measure the time spent in a scope  <a href="classpcl_1_1_scope_time.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_event_frequency.html">pcl::EventFrequency</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A helper class to measure frequency of a certain event.  <a href="classpcl_1_1_event_frequency.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
宏定义</h2></td></tr>
<tr class="memitem:ae79acf8eb730f80c029d60e19332b4b9"><td class="memItemLeft" align="right" valign="top"><a id="ae79acf8eb730f80c029d60e19332b4b9"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>MEASURE_FUNCTION_TIME</b>&#160;&#160;&#160;  ScopeTime scopeTime(__func__)</td></tr>
<tr class="separator:ae79acf8eb730f80c029d60e19332b4b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9b9f34c01b03b47644c2762bf256be32"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_2time_8h.html#a9b9f34c01b03b47644c2762bf256be32">DO_EVERY_TS</a>(secs,  currentTime,  <a class="el" href="structcode.html">code</a>)</td></tr>
<tr class="memdesc:a9b9f34c01b03b47644c2762bf256be32"><td class="mdescLeft">&#160;</td><td class="mdescRight">Executes code, only if secs are gone since last exec.  <a href="common_2time_8h.html#a9b9f34c01b03b47644c2762bf256be32">更多...</a><br /></td></tr>
<tr class="separator:a9b9f34c01b03b47644c2762bf256be32"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abfe958da8833edbe74250507adc61635"><td class="memItemLeft" align="right" valign="top"><a id="abfe958da8833edbe74250507adc61635"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_2time_8h.html#abfe958da8833edbe74250507adc61635">DO_EVERY</a>(secs,  <a class="el" href="structcode.html">code</a>)&#160;&#160;&#160;  <a class="el" href="common_2time_8h.html#a9b9f34c01b03b47644c2762bf256be32">DO_EVERY_TS</a>(secs, pcl::getTime(), <a class="el" href="structcode.html">code</a>)</td></tr>
<tr class="memdesc:abfe958da8833edbe74250507adc61635"><td class="mdescLeft">&#160;</td><td class="mdescRight">Executes code, only if secs are gone since last exec. <br /></td></tr>
<tr class="separator:abfe958da8833edbe74250507adc61635"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:af09b8b74e8f5988cbef7b8eb60d0fcfb"><td class="memItemLeft" align="right" valign="top"><a id="af09b8b74e8f5988cbef7b8eb60d0fcfb"></a>
double&#160;</td><td class="memItemRight" valign="bottom"><b>pcl::getTime</b> ()</td></tr>
<tr class="separator:af09b8b74e8f5988cbef7b8eb60d0fcfb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>Define methods for measuring time spent in code blocks </p>
</div><h2 class="groupheader">宏定义说明</h2>
<a id="a9b9f34c01b03b47644c2762bf256be32"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9b9f34c01b03b47644c2762bf256be32">&#9670;&nbsp;</a></span>DO_EVERY_TS</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DO_EVERY_TS</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">secs, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">currentTime, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><a class="el" href="structcode.html">code</a>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>值:</b><div class="fragment"><div class="line"><span class="keywordflow">if</span> (1) {\</div>
<div class="line">  static <span class="keywordtype">double</span> s_lastDone_ = 0.0; \</div>
<div class="line">  double s_now_ = (currentTime); \</div>
<div class="line">  if (s_lastDone_ &gt; s_now_) \</div>
<div class="line">    s_lastDone_ = s_now_; \</div>
<div class="line">  if ((s_now_ - s_lastDone_) &gt; (secs)) {        \</div>
<div class="line">    code; \</div>
<div class="line">    s_lastDone_ = s_now_; \</div>
<div class="line">  }\</div>
<div class="line">} <span class="keywordflow">else</span> \</div>
<div class="line">  (void)0</div>
</div><!-- fragment -->
<p>Executes code, only if secs are gone since last exec. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_bdd9a5d540de89e9fe90efdfc6973a4f.html">common</a></li><li class="navelem"><a class="el" href="dir_11fbc4217d50ab21044e5ad6614aede5.html">include</a></li><li class="navelem"><a class="el" href="dir_39ef148c3cf3468c290ae8c03b3c03af.html">pcl</a></li><li class="navelem"><a class="el" href="dir_474708a720ff06817ce2c12e28baf137.html">common</a></li><li class="navelem"><a class="el" href="common_2time_8h.html">time.h</a></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
